package com.yangcsoft.modules.deptmanage.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yangcsoft.common.utils.PageUtils;
import com.yangcsoft.common.utils.Query;

import com.yangcsoft.modules.deptmanage.dao.WeeklyInfoDao;
import com.yangcsoft.modules.deptmanage.entity.WeeklyInfoEntity;
import com.yangcsoft.modules.deptmanage.service.WeeklyInfoService;


@Service("weeklyInfoService")
public class WeeklyInfoServiceImpl extends ServiceImpl<WeeklyInfoDao, WeeklyInfoEntity> implements WeeklyInfoService {
    @Autowired
    private WeeklyInfoDao dao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String key = params.get("key").toString();
        Page<WeeklyInfoEntity> page = this.selectPage(
                new Query<WeeklyInfoEntity>(params).getPage(),
                new EntityWrapper<WeeklyInfoEntity>()
                                             .like("weekly_no",key)
                 .or()
                                                             .like("userseq",key)
                 .or()
                                                             .like("now_weekly",key)
                 .or()
                                                             .like("next_weekly",key)
                 .or()
                                                             .like("weekly_start_date",key)
                 .or()
                                                             .like("weekly_end_date",key)
                 .or()
                                                             .like("create_date",key)
                 .or()
                                                             .like("create_user",key)
                 .or()
                                                             .like("update_date",key)
                 .or()
                                                            .like("update_user",key)
                                    );

        return new PageUtils(page);
    }

    @Override
    public void save(WeeklyInfoEntity entity) {
        dao.save(entity);
    }


}
